import { readFileSync, writeFileSync } from "node:fs";
import asciidoctor from "asciidoctor";

const Asciidoctor = asciidoctor();

writeFileSync(
  "dist/disclaimer.html",
  `<!doctype html>
<html lang="zh-CN">
  <head>
    <title>开源组件许可声明</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <style>body > div * {font-family: monospace !important; color-scheme: light dark; list-style-type: none;} #toctitle {display: none;} pre {background-color: rgba(88, 99, 123, 0.25); padding: 0.5rem; padding-left: 1.5rem; overflow-x: scroll;}</style>
  </head>
  <body>
    <h1>开源组件许可声明</h1>
    ${Asciidoctor.convert(readFileSync("./license-disclaimer.adoc"))}
  </body>
</html>
`,
);
